﻿Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design

Namespace System.Workflow.ComponentModel
    Friend NotInheritable Class SynchronizationHandlesEditor
        Inherits UITypeEditor
        ' Methods
        Public Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As Object) As Object
            Dim str As String = SynchronizationHandlesTypeConverter.Stringify([TryCast](value,ICollection([Of] String)))
            str = [TryCast](Me.stringEditor.EditValue(context, provider, str),String)
            value = SynchronizationHandlesTypeConverter.UnStringify(str)
            Return value
        End Function

        Public Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As UITypeEditorEditStyle
            Return Me.stringEditor.GetEditStyle(context)
        End Function

        Public Overrides Function GetPaintValueSupported(ByVal context As ITypeDescriptorContext) As Boolean
            Return Me.stringEditor.GetPaintValueSupported(context)
        End Function


        ' Fields
        Private stringEditor As MultilineStringEditor = New MultilineStringEditor
    End Class
End Namespace

